<template>
  <div>
    <h2 align="center">管理员--查看用户投资明细</h2>
    <table class="table table-bordered">
      <tr>
        <td>投资人登录账号</td>
        <td>投资金额</td>
        <td>投资时间</td>
      </tr>

      <tr v-for="item in list" :key="item.I_Id">
        <td>{{ item.T_UserLogins.UL_Name }}</td>
        <td>{{ item.UI_Money }}</td>
        <td>{{ item.UI_Date.slice("T",10) }}</td>
      </tr>
    </table>
  </div>
</template>

<script setup lang="ts">

import {reactive,toRefs,onMounted} from 'vue'

import axios from 'axios';

import {useRouter,useRoute} from 'vue-router'

let router = useRouter()
let route = useRoute()

//数据
let data:any = reactive({
  list:[]

})

let {list} = toRefs(data)

onMounted(()=>{
  gerList()
})

//根据投资的ID查询当前项目有哪些人投资
const gerList =()=>{
  axios({
    url:'/api/Invest/GetAllUsersInvestInfos',
    method:'get',
    params:{
      I_Id:route.query.I_Id
    }
  }).then(res=>{
    console.log(res);
    list.value=res.data.data
  }).catch(err=>{
    console.log(err);
  })
}

</script>

<style scoped>

</style>